const http = require("http");
//引入url模块
const url = require("url");

http.createServer(function (request, response) {


    if (request.url !== "/favicon.ico") {
        /**
         * 第一个参数：获取的路径
         * true 将get传值转换为对象
         */
        const result = url.parse(request.url, true);
        console.log(result.query.name);
    }


    response.writeHead(200, {"Content-Type": "text/html;charset=utf-8"});
    response.write("你好 node.js  ");
    response.write("你好世界");
    response.end()

}).listen(8001);

